package wordroid.activitys;

import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.app.TabActivity;
import android.content.Context;
import android.content.res.Resources;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TabHost;
import android.widget.TabHost.TabContentFactory;
import android.widget.TabHost.TabSpec;
import android.widget.TextView;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import wordroid.business.OperationOfBooks;
import wordroid.database.DataAccess;
import wordroid.model.BookList;
import wordroid.model.WordList;

public class ReviewMain extends TabActivity
  implements TabHost.TabContentFactory
{
  private ArrayList<String> listShould;
  private int week = 0;
  public ArrayList<WordList> wordlist;

  private List<Map<String, Object>> getData(String paramString)
  {
	return null;/*
    ArrayList localArrayList1 = new ArrayList();
    int l;
    if (paramString.equals("shouldreview"))
    {
      l = 0;
      label20: if (l < this.wordlist.size());
    }
    do
    {
      int k;
      do
      {
        return localArrayList1;
        if (((WordList)this.wordlist.get(l)).getShouldReview().equals("1"))
        {
          HashMap localHashMap3 = new HashMap();
          localHashMap3.put("label", " LIST-" + ((WordList)this.wordlist.get(l)).getList());
          localHashMap3.put("times", "已复习次数：" + ((WordList)this.wordlist.get(l)).getReview_times());
          localHashMap3.put("lasttime", "上次复习时间：" + ((WordList)this.wordlist.get(l)).getReviewTime());
          localHashMap3.put("image", Integer.valueOf(17301516));
          localArrayList1.add(localHashMap3);
        }
        ++l;
        break label20:
        if (!(paramString.equals("alllists")))
          break label489;
        label228: k = 0;
      }
      while (k >= this.wordlist.size());
      HashMap localHashMap2 = new HashMap();
      localHashMap2.put("label", "LIST-" + ((WordList)this.wordlist.get(k)).getList());
      if (((WordList)this.wordlist.get(k)).getLearned().equals("0"))
      {
        localHashMap2.put("state", "状态：未学习  ");
        localHashMap2.put("image", Integer.valueOf(17301515));
      }
      while (true)
      {
        localArrayList1.add(localHashMap2);
        ++k;
        break label228:
        if (((WordList)this.wordlist.get(k)).getShouldReview().equals("1"))
        {
          localHashMap2.put("state", "状态：该复习了！ ");
          localHashMap2.put("image", Integer.valueOf(17301516));
        }
        if (Integer.parseInt(((WordList)this.wordlist.get(k)).getReview_times()) >= 5)
        {
          localHashMap2.put("state", "状态：复习已完成！ ");
          localHashMap2.put("image", Integer.valueOf(17301515));
        }
        localHashMap2.put("state", "状态：暂不需复习  ");
        label489: localHashMap2.put("image", Integer.valueOf(17301515));
      }
    }
    while (!(paramString.equals("plan")));
    new ArrayList();
    ArrayList localArrayList2 = new OperationOfBooks().GetPlan(this.week, this);
    int i = 0;
    while (true)
    {
      if (i < 7);
      HashMap localHashMap1 = new HashMap();
      localHashMap1.put("date", ((ArrayList)localArrayList2.get(i)).get(0));
      SimpleDateFormat localSimpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
      Object localObject = null;
      label608: String str1;
      String str2;
      label676: int j;
      try
      {
        Date localDate = localSimpleDateFormat.parse((String)((ArrayList)localArrayList2.get(i)).get(0));
        localObject = localDate;
        Calendar localCalendar = Calendar.getInstance();
        localCalendar.setTime(localObject);
        str1 = "复习内容：";
        str2 = "星期";
        switch (localCalendar.get(7))
        {
        default:
          localHashMap1.put("day", str2);
          j = 1;
          label691: if (j < ((ArrayList)localArrayList2.get(i)).size())
            break label953;
          if (((ArrayList)localArrayList2.get(i)).size() != 1)
            break label1002;
          localHashMap1.put("image", Integer.valueOf(2130837538));
          label741: localHashMap1.put("lists", str1);
          localArrayList1.add(localHashMap1);
          label953: label1002: ++i;
        case 1:
        case 2:
        case 3:
        case 4:
        case 5:
        case 6:
        case 7:
        }
      }
      catch (ParseException localParseException)
      {
        localParseException.printStackTrace();
        break label608:
        str2 = str2 + "一  ";
        break label676:
        str2 = str2 + "二  ";
        break label676:
        str2 = str2 + "三  ";
        break label676:
        str2 = str2 + "四  ";
        break label676:
        str2 = str2 + "五  ";
        break label676:
        str2 = str2 + "六  ";
        break label676:
        str2 = str2 + "日  ";
        break label676:
        str1 = str1 + ((String)((ArrayList)localArrayList2.get(i)).get(j)) + " ";
        ++j;
        break label691:
        localHashMap1.put("image", Integer.valueOf(2130837539));
        break label741:
      }
    }
  */}

  private void startReview(int paramInt1, int paramInt2)
  {
    if (paramInt2 == 1);
    for (String str = (String)this.listShould.get(paramInt1); ; str = String.valueOf(paramInt1))
    {
      new AlertDialog.Builder(this).setIcon(2130837509).setTitle("开始复习：").setMessage("LIST-" + str).setPositiveButton("确定", /*new 6(this, paramInt2, paramInt1)*/null).setNeutralButton("取消",/* new 7(this)*/null).create().show();
      return;
    }
  }

  public View createTabContent(String paramString)
  {
    TextView localTextView = new TextView(this);
    localTextView.setTextColor(-16777216);
    localTextView.setBackgroundDrawable(getResources().getDrawable(2130837520));
    ListView localListView = new ListView(this);
    localListView.setCacheColorHint(0);
    LinearLayout localLinearLayout1 = new LinearLayout(this);
    localLinearLayout1.setBackgroundDrawable(getResources().getDrawable(2130837519));
    localLinearLayout1.setOrientation(1);
    if (paramString.equals("shouldreview"))
    {
      localTextView.setText("   需要进行复习的LIST");
      localLinearLayout1.addView(localTextView);
      localListView.addHeaderView(LayoutInflater.from(this).inflate(2130903043, null));
      List localList3 = getData(paramString);
      String[] arrayOfString3 = new String[4];
      arrayOfString3[0] = "label";
      arrayOfString3[1] = "times";
      arrayOfString3[2] = "lasttime";
      arrayOfString3[3] = "image";
      int[] arrayOfInt3 = new int[4];
      arrayOfInt3[0] = 2131165200;
      arrayOfInt3[1] = 2131165201;
      arrayOfInt3[2] = 2131165202;
      arrayOfInt3[3] = 2131165199;
      localListView.setAdapter(new SimpleAdapter(this, localList3, 2130903046, arrayOfString3, arrayOfInt3));
      localListView.setOnItemClickListener(/*new 1(this)*/null);
      localListView.setOnItemLongClickListener(/*new 2(this)*/null);
      localLinearLayout1.addView(localListView);
    }
    if (paramString.equals("alllists"))
    {
      localTextView.setText("   所有的LIST");
      localLinearLayout1.addView(localTextView);
      localListView.addHeaderView(LayoutInflater.from(this).inflate(2130903043, null));
      List localList2 = getData(paramString);
      String[] arrayOfString2 = new String[3];
      arrayOfString2[0] = "label";
      arrayOfString2[1] = "state";
      arrayOfString2[2] = "image";
      int[] arrayOfInt2 = new int[3];
      arrayOfInt2[0] = 2131165200;
      arrayOfInt2[1] = 2131165204;
      arrayOfInt2[2] = 2131165203;
      localListView.setAdapter(new SimpleAdapter(this, localList2, 2130903047, arrayOfString2, arrayOfInt2));
      localListView.setOnItemClickListener(/*new 3(this)*/null);
      localLinearLayout1.addView(localListView);
    }
    if (paramString.equals("plan"))
    {
      localTextView.setText("   我的复习计划");
      localListView.addHeaderView(LayoutInflater.from(this).inflate(2130903043, null));
      List localList1 = getData(paramString);
      String[] arrayOfString1 = new String[4];
      arrayOfString1[0] = "date";
      arrayOfString1[1] = "lists";
      arrayOfString1[2] = "day";
      arrayOfString1[3] = "image";
      int[] arrayOfInt1 = new int[4];
      arrayOfInt1[0] = 2131165206;
      arrayOfInt1[1] = 2131165208;
      arrayOfInt1[2] = 2131165207;
      arrayOfInt1[3] = 2131165205;
      localListView.setAdapter(new SimpleAdapter(this, localList1, 2130903048, arrayOfString1, arrayOfInt1));
      Button localButton1 = new Button(this);
      new DisplayMetrics();
      int i = getApplicationContext().getResources().getDisplayMetrics().widthPixels;
      localButton1.setWidth(i / 2);
      Button localButton2 = new Button(this);
      localButton1.setText("下一周");
      localButton1.setBackgroundDrawable(getResources().getDrawable(2130837550));
      localButton1.setOnClickListener(/*new 4(this, localButton2, localListView, paramString)*/null);
      localButton2.setBackgroundDrawable(getResources().getDrawable(2130837550));
      localButton2.setText("上一周");
      localButton2.setWidth(i / 2);
      localButton2.setOnClickListener(/*new 5(this, localButton2, localListView, paramString)*/null);
      LinearLayout localLinearLayout2 = new LinearLayout(this);
      localLinearLayout2.setOrientation(0);
      localLinearLayout2.addView(localButton2);
      localLinearLayout2.addView(localButton1);
      localButton2.setEnabled(false);
      localLinearLayout1.addView(localTextView);
      localLinearLayout1.addView(localLinearLayout2);
      localLinearLayout1.addView(localListView);
    }
    return localLinearLayout1;
  }

  public void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    TabHost localTabHost = getTabHost();
    DataAccess localDataAccess = new DataAccess(this);
    this.wordlist = localDataAccess.QueryList("BOOKID ='" + DataAccess.bookID + "'", null);
    BookList localBookList = (BookList)localDataAccess.QueryBook("ID ='" + DataAccess.bookID + "'", null).get(0);
    this.listShould = new ArrayList(this.wordlist.size());
    for (int i = 0; ; ++i)
    {
      if (i >= this.wordlist.size())
      {
        setTitle("复习-" + localBookList.getName());
        localTabHost.addTab(localTabHost.newTabSpec("shouldreview").setIndicator("该复习的LIST", getResources().getDrawable(2130837541)).setContent(this));
        localTabHost.addTab(localTabHost.newTabSpec("alllists").setIndicator("所有LIST", getResources().getDrawable(2130837504)).setContent(this));
        localTabHost.addTab(localTabHost.newTabSpec("plan").setIndicator("我的复习计划", getResources().getDrawable(2130837537)).setContent(this));
        return;
      }
      if (!(((WordList)this.wordlist.get(i)).getShouldReview().equals("1")))
        continue;
      this.listShould.add(((WordList)this.wordlist.get(i)).getList());
    }
  }
}

/* Location:           E:\Desktop\Android\英语词汇记忆\classes_dex2jar.jar
 * Qualified Name:     wordroid.activitys.ReviewMain
 * JD-Core Version:    0.5.3
 */